//
//  topButtonItem.swift
//  HMXMeiTuan
//
//  Created by apple on 16/7/20.
//  Copyright © 2016年 apple. All rights reserved.
//

//该类用于定义导航栏上左侧功能栏的相关设置

import UIKit

class topButtonItem: UIView {

    @IBOutlet weak var titleBtn: UIButton!
    
    @IBOutlet weak var titleLabel: UILabel!
    
    @IBOutlet weak var subtitleLabel: UILabel!
}

//MARK:- 该方法用于加载xib
extension topButtonItem{

    class func viewForXib() -> topButtonItem{
    
       return NSBundle.mainBundle().loadNibNamed("topButtonItem", owner: nil, options: nil).last as! topButtonItem
        
    }
    
 }

//MARK:- 用于设置导航栏顶部按钮的相关信息
extension topButtonItem{
    
    func settopView(iconName : String, iconNameHighLighted : String, title: String, subTitle: String){
        
        titleBtn.setImage(UIImage(named: iconName) , forState: .Normal)
        titleBtn.setImage(UIImage(named: iconNameHighLighted) , forState: .Highlighted)
        titleLabel.text = title
        subtitleLabel.text = subTitle
    }
}

